﻿#define _CRT_SECURE_NO_WARNINGS 1
#include "SList.h"

void SListTest()
{
	//测试尾插
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPrint(plist);

	////测试头插
	//SLTPushFront(&plist, 9);
	//SLTPrint(plist);
	//SLTPushFront(&plist, 8);
	//SLTPrint(plist);
	//SLTPushFront(&plist, 7);
	//SLTPrint(plist);
	//SLTPushFront(&plist, 6);
	//SLTPrint(plist);

	////测试尾删
	//SLTPopBack(&plist);
	//SLTPrint(plist);
	//SLTPopBack(&plist);
	//SLTPrint(plist);
	//SLTPopBack(&plist);
	//SLTPrint(plist);
	//SLTPopBack(&plist);
	//SLTPrint(plist);

	////测试头删
	//SLTPopFront(&plist);
	//SLTPrint(plist);
	//SLTPopFront(&plist);
	//SLTPrint(plist);
	//SLTPopFront(&plist);
	//SLTPrint(plist);
	//SLTPopFront(&plist);
	//SLTPrint(plist);

	////测试查找
	//SLTNode* find = SLTFind(plist, 3);
	//if (find == NULL)
	//{
	//	printf("找不到");
	//}
	//else
	//{
	//	printf("找到了\n");
	//	SLTPrint(find);
	//}

	////测试在指定位置之前插⼊数据
	//SLTNode* find = SLTFind(plist, 4);
	//SLTInsert(&plist, find, 6);
	//SLTPrint(plist);

	////测试在指定位置之后插⼊数据
	//SLTNode* find = SLTFind(plist, 2);
	//SLTInsertAfter(find, 6);
	//SLTPrint(plist);

	////测试删除pos节点
	//SLTNode* find = SLTFind(plist, 4);
	//SLTErase(&plist, find);
	//SLTPrint(plist);

	////测试删除pos之后的节点
	//SLTNode* find = SLTFind(plist, 1);
	//SLTEraseAfter(find);
	//SLTPrint(plist);


}

int main()
{
	SListTest();

	return 0;
}
